feat(admin): activation-aware tabs, readiness badge, activity search, invite copy-link#4308
Conversation
Tab descriptors may carry an optional 'module' field naming their owning optional module; resolveSurfaceTabs gains an optional isActive predicate (default keep-all) that hides tabs whose module is deactivated. Routes are already gated at injection time — this closes the matching render-time gap where a baked config tab for a deactivated module clicked through to a 404. refs #4295
Tag the admin Invitations + account Referrals tab descriptors with module: 'invitations' and pass isModuleActive as resolveSurfaceTabs' third argument from CoreSurfaceTabBar (the single call site, so every surface gets the gate). Regenerates src/config/index.js (gitignored build artifact). Render-time filtering keeps one source of truth (isModuleActive) instead of pruning at generation time across the 5 merge layers. refs #4295
Downstream projects overriding admin.tabs/users.extraTabs must tag module-owned descriptors with the new module field; tabs without it are always shown. refs #4295
The Readiness tab already reports mail-provider status ('mail' readiness
row); the admin layout banner duplicated that signal on every admin tab.
Remove the v-alert + showMailerWarning computed + now-unused useAuthStore
import, and delete the orphan AuthAdminMailerWarning snackbar component
(imported only by its own unit test).
refs #4297
Derive the non-ok readiness check count client-side from the admin store and decorate the built-in readiness tab descriptor with an optional numeric badge. CoreSurfaceTabBar renders it as a small tonal warning chip after the label — additive, tabs without a badge render exactly as before, so the account and organization surfaces sharing the component are unaffected. The layout fetches readiness on mount only when the store is empty and skips entirely when landing on the readiness tab, whose view already fetches on its own mount (child mounted runs first, so an empty-store check alone cannot prevent the double GET). refs pierreb-devkit/Node#3836
Mirror the datatable card-title row on the Activity tab: title + spacer + Clear action + two compact outlined filter fields, debounced 1000ms like the datatable search (replaces the enter-key + Search-button flow). Gate the user-ID filter on a client-side ObjectId check since GET /audit 400s on malformed userId values; dedupe the trailing debounce so Clear does not double-fetch. max-width stays a Vuetify prop (no inline styles in this view). refs #4296
POST /invitations/:id/resend mirroring the create/delete error contract (sanitized banner + rethrow). Pins createInvitation's return value as the one-time token source for copy-link: the list endpoint strips tokens, only the create response carries one. refs pierreb-devkit/Node#3834
After create the dialog stays open showing the signup link once (the list payload is token-stripped, the create response is the only token source) with a clipboard copy button — local label flip, no snackbar (interceptor-only). Paper-plane resend action on pending rows, single-flight, toasted by the POST interceptor. refs pierreb-devkit/Node#3834
Surface the signup link once after create in the account Referrals form (success alert + clipboard button, local Copied label flip). Same one-time constraint as the admin dialog: the list payload is token-stripped, only the create response carries the token. refs pierreb-devkit/Node#3834
|
Warning Review limit reached
More reviews will be available in 42 minutes and 55 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (18)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4308 +/- ##
=======================================
Coverage 99.59% 99.59%
=======================================
Files 32 32
Lines 1225 1234 +9
Branches 361 363 +2
=======================================
+ Hits 1220 1229 +9
Misses 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR batches several Admin/Account UX follow-ups around shared “surface tab” infrastructure: tabs now respect optional-module activation at render time, Admin readiness gets a warning-count badge, Admin Activity search/filters are moved into the standard card-title layout with debounced fetching, and Invitations gain a one-time copy-link flow plus a resend action (while removing the redundant admin mailer banner/component).
Changes:
- Add activation-aware surface-tab filtering via
resolveSurfaceTabs(..., isActive)and propagate it throughCoreSurfaceTabBar(with invitations tabs tagged as module-owned). - Add an optional per-tab numeric
badgerendered byCoreSurfaceTabBar, and decorate the Admin Readiness tab using readiness data fetched byadmin.layout. - Improve Invitations UX (one-time copy-link + resend) and restyle Admin Activity with debounced card-title filters; remove the deprecated mailer warning banner/component.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/modules/invitations/views/invitations.admin.view.vue | Adds resend action and one-time copy-link panel after invite creation. |
| src/modules/invitations/views/invitations.account.view.vue | Adds one-time copy-link success block after invite creation on the account referrals surface. |
| src/modules/invitations/tests/invitations.store.unit.tests.js | Adds unit coverage for create token contract and resendInvitation behavior. |
| src/modules/invitations/tests/invitations.admin.view.unit.tests.js | Adds tests for admin copy-link + resend behaviors (clipboard mock included). |
| src/modules/invitations/tests/invitations.account.view.unit.tests.js | Adds tests for account copy-link behavior (clipboard mock included). |
| src/modules/invitations/stores/invitations.store.js | Adds resendInvitation() and clarifies create response includes one-time token. |
| src/modules/invitations/config/invitations.development.config.js | Tags invitations-contributed tabs with module: 'invitations' for activation filtering. |
| src/modules/core/components/tests/core.surfaceTabBar.component.unit.tests.js | Adds tests for optional tab badge rendering. |
| src/modules/core/components/core.surfaceTabBar.component.vue | Passes isModuleActive into resolveSurfaceTabs and renders optional badge chip. |
| src/modules/auth/tests/auth.adminMailerWarning.component.unit.tests.js | Removes tests for deleted admin mailer warning component. |
| src/modules/auth/components/auth.adminMailerWarning.component.vue | Deletes the orphaned mailer warning snackbar component. |
| src/modules/admin/views/admin.layout.vue | Removes mailer banner; fetches readiness for tab badge; decorates Readiness tab with badge. |
| src/modules/admin/views/admin.activity.view.vue | Moves filters into card-title layout; adds 1s debounce and ObjectId gating for userId filter. |
| src/modules/admin/tests/admin.layout.unit.tests.js | Updates expectations: no mailer banner; readiness fetch + readiness badge behavior. |
| src/modules/admin/tests/admin.activity.view.unit.tests.js | Adds tests for debounced filter behavior and updated card-title chrome. |
| src/lib/helpers/tests/surface-tabs.unit.tests.js | Adds tests for module-activation filtering parameter. |
| src/lib/helpers/surface-tabs.js | Extends resolveSurfaceTabs with optional activation predicate and module filtering. |
| MIGRATIONS.md | Documents activation-aware surface tab filtering change and downstream action items. |
… jsdoc - encodeURIComponent(token) in signupLink() on both admin + account views - aria-label="Resend invitation" on the icon-only resend button (a11y) - correct resendInvite() jsdoc: global in-flight guard, not per-row
Summary
Five admin/account UX follow-ups from the invitations/org hardening tracker, batched (they share the
admin.layout/core.surfaceTabBarsurfaces so they land in one branch):resolveSurfaceTabsgains anisActivepredicate; tab descriptors carry an optionalmodulefield (invitationstabs tagged), andCoreSurfaceTabBarpassesisModuleActive— a deactivated module's tabs no longer render (they used to bake in and click through to a 404). Render-time filter (one source of truth:isModuleActive), not generation-time pruning./admin"No mailer configured"v-alert(+ its computed) and deleted a dead orphanauth.adminMailerWarningcomponent + test. The signal lives in the Readiness tab only (the Node half precisions its wording — fix(home): precise readiness mail-warning wording (#4297 Node half) Node#3861).v-chipvia a new optionalbadgefield on the tab bar (additive — account/org surfaces unaffected).auditTotalpagination.navigator.clipboard, label flips Copy → Copied) + a resend icon-button on pending rows +invitationsStore.resendInvitation.Test plan
surface-tabs 37 · core.surfaceTabBar 12 · admin.layout 21 · admin.activity 24 · invitations store 14 / admin 28 / account 25 — all green; lint clean. (2 pre-existing billing v-progress-linear snapshot failures repo-wide are untouched/unrelated.)
Guardrails
npm run lintcleanCloses #4295
Closes #4296
Closes pierreb-devkit/Node#3836
Refs #4297
Refs pierreb-devkit/Node#3834